<?php

/**
 * zc_return_visits form base class.
 *
 * @method zc_return_visits getObject() Returns the current form's model object
 *
 * @package    zc
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class Basezc_return_visitsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'rv_id'        => new sfWidgetFormInputHidden(),
      'rv_time'      => new sfWidgetFormDate(),
      'rv_content'   => new sfWidgetFormTextarea(),
      'rv_next_time' => new sfWidgetFormDate(),
      'rv_question'  => new sfWidgetFormTextarea(),
      'rv_info'      => new sfWidgetFormTextarea(),
      'info_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('zc_user_info'), 'add_empty' => true)),
      'si_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('zc_susscu_intention'), 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'rv_id'        => new sfValidatorChoice(array('choices' => array($this->getObject()->get('rv_id')), 'empty_value' => $this->getObject()->get('rv_id'), 'required' => false)),
      'rv_time'      => new sfValidatorDate(array('required' => false)),
      'rv_content'   => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'rv_next_time' => new sfValidatorDate(array('required' => false)),
      'rv_question'  => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'rv_info'      => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'info_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('zc_user_info'), 'required' => false)),
      'si_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('zc_susscu_intention'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('zc_return_visits[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'zc_return_visits';
  }

}
